package com.yunji.ylexpiration.mapper;

import com.yunji.ylexpiration.entity.FurnCommodity;
import com.yunji.ylexpiration.entity.FurnCommodityExample;
import com.yunji.ylexpiration.entity.FurnCommodityKey;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface FurnCommodityMapper {
    int countByExample(FurnCommodityExample example);

    int deleteByExample(FurnCommodityExample example);

    int deleteByPrimaryKey(FurnCommodityKey key);

    int insert(FurnCommodity record);

    int insertSelective(FurnCommodity record);

    List<FurnCommodity> selectByExample(FurnCommodityExample example);

    FurnCommodity selectByPrimaryKey(FurnCommodityKey key);

    int updateByExampleSelective(@Param("record") FurnCommodity record, @Param("example") FurnCommodityExample example);

    int updateByExample(@Param("record") FurnCommodity record, @Param("example") FurnCommodityExample example);

    int updateByPrimaryKeySelective(FurnCommodity record);

    int updateByPrimaryKey(FurnCommodity record);

    //查询摆件花艺的,limit为6
    List<FurnCommodity> selectByClassificationtype_idandLimit6(Integer [] classId);

    //查询墙式壁挂的,limit为16
    List<FurnCommodity> selectByClassificationtype_parent_idandLimit16(Integer [] classId2);

    //查询分类的所有商品
    List<FurnCommodity> selectByClassificationtype_parent_id(@Param("snum") Integer snum,@Param("price") Integer price,@Param("typename") String typename,@Param("typename2") String typename2,@Param("pagenum")Integer pagenum,@Param("pagecount")Integer pagecount);

    //查询分类的所有商品总数量
    List<FurnCommodity> CountByClassificationtype_parent_id(@Param("typename")String typename,@Param("typename2") String typename2);

    //查询墙式壁挂、蜡艺香薰、创意家居
    List<FurnCommodity> selectByClassId(@Param("typename") String typename,@Param("classId3") Integer [] classId3);

    //搜索查询
    List<FurnCommodity> searchByProductName(@Param("snum") Integer snum,@Param("price") Integer price,@Param("productname")String productname,@Param("productname2")String productname2,@Param("productname3")String productname3,@Param("pagenum")Integer pagenum,@Param("pagecount")Integer pagecount);

    //模糊查询的商品数量
    List<FurnCommodity> SearchByCount(@Param("productname")String productname,@Param("productname2")String productname2,@Param("productname3")String productname3);

    //详细页码的猜你喜欢,显示相关类型的数据15条,且销量排名前15
    List<FurnCommodity> RelatedByLimit15(@Param("ClassId") Integer ClassId,@Param("ParentId") Integer ParentId,@Param("pagenum")Integer pagenum,@Param("pagecount")Integer pagecount);
}